<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.util.List"%>
<%@ page import="model.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>捧腹网</title>
<script src="js/jquery-1.7.min.js"></script>
<script type="text/javascript">
	$(function() {
		$('.type').click(function() {
			alert($(this).html());
		});// end click
		
	});
</script>
<style type="text/css">
.content-right {
	float: right;
	width: 300px;
	text-align: center;
	overflow: hidden;
}

.photo {
	width: 130px;
	height: 130px;
}

</style>
<link href="css/style.css" media="screen, projection" rel="stylesheet" type="text/css" />
</head>
<body>
	<!-- Header Start -->
	<div id="header" class="head">
		<div class="content-block">
			<div class="logo" id="hd_logo">
				<img src="photos/logo.png">
			</div>
			<div id="menu" class="menu-bar menu clearfix">
				<a href="IndexServlet" style = "color:#faf40f">首页</a> 
				<a href="AnnServlet?action=reading">热门</a>
				<a href="AnnServlet?action=music">趣闻</a> 
				<a href="AnnServlet?action=film">神回复</a>
			</div>
			<c:if test="${ empty logoner }">
			<div class="userbar clearfix">
				<div class="logout">
					<a href="pages/logon.jsp" class="fn-signin-required logintop"
						id='logintop' rel="nofollow">登录/</a> <a
						href="pages/register.jsp" class="fn-signin-required logintop"
						id='logintop' rel="nofollow">注册</a>
				</div>
			</div>
			</c:if>
			<c:if test="${ not empty logoner }">
				<div class="userbar clearfix">
					<div class="logout">
						<a href="HostServlet?userId=${ logoner.getUserId() }" class="fn-signin-required logintop" id='logintop'
							rel="nofollow">${ logoner.getUserName() }</a>
						&nbsp;<a href="UserServlet?action=logout">退出</a>
					</div>
				</div>
			</c:if>
		</div>
	</div>
	<br>
	<div id="content" class="main">
		<div class="content-block clearfix">
			<div id="content-left" class="col1" style="margin:1px 0">
				<c:if test="${empty readingList }">
				没有读书帖子
				</c:if>
				<c:if test="${not empty readingList }">
				<c:forEach items="${readingList}" var="aai" varStatus="annStatus">
				<div class="article block untagged mb15" id='qiushi_tag_114186367'>
					<div class="author clearfix">
						 <a href="HostServlet?userId=${readUserList[annStatus.index].getUserId()}" target="_blank" rel="nofollow"> 
						 <img src="${readUserList[annStatus.index].getUserShow()}" />
						 </a> 
						 <a href="ReadServlet?ID=${aai.getAnnID()}">
							<h2>${aai.getAnnTopic()}</h2>
						</a>
					</div>
					<div class="desc">${aai.getAnnBody()}</div>
<%-- 					<span class="dash"> <a href="/article/114186367"
						data-share="/article/114186367" id="c-114186367"
						class="qiushi_comments" target="_blank"> <i class="number">${aai.getAnnRacc()}</i>
							评论
					</a> --%>
					</span> 
				</div>
				</c:forEach>
				</c:if>
				<c:if test="${empty musicList}">
					没有音乐帖子
				</c:if>
				
				<c:if test="${not empty musicList}">
				<c:forEach items="${musicList}" var="aai" varStatus="aaiStatus">
				<div class="article block untagged mb15" id='qiushi_tag_114186367'>

					<div class="author clearfix">
						<a href="HostServlet?userId=${musicUserList[aaiStatus.index].getUserId()}" target="_blank" rel="nofollow"> <img
							src="${musicUserList[aaiStatus.index].getUserShow()}" />
						</a> 
						<a href="ReadServlet?ID=${aai.getAnnID()}">
							<h1>${aai.getAnnTopic()}</h1>
						</a>
					</div>
					<div class="desc">${aai.getAnnBody()}</div>

<%-- 					<span class="dash"> <a href="/article/114186367"
						data-share="/article/114186367" id="c-114186367"
						class="qiushi_comments" target="_blank"> <i class="number">${aai.getAnnRacc()}</i>
							评论
					</a>
					</span>  --%>
				</div>
				</c:forEach>
				</c:if>
				<c:if test="${empty filmList}">
					没有电影类帖子
				</c:if>
				<c:if test="${not empty filmList}">
					<c:forEach items="${filmList}" var="aai" varStatus="aaiStatus">
					<div class="article block untagged mb15" id='qiushi_tag_114186367'>
						<div class="author clearfix">
							<a href="HostServlet?userId=${filmUserList[aaiStatus.index].getUserId()}" target="_blank" rel="nofollow"> <img
								src="${filmUserList[aaiStatus.index].getUserShow()}" />
							</a> <a href="ReadServlet?ID=${aai.getAnnID()}">
								<h1>${aai.getAnnTopic()}</h1>
							</a>
						</div>
						<div class="desc">${aai.getAnnBody()}</div>
	
<%-- 						<span class="dash"> <a href="/article/114186367"
							data-share="/article/114186367" id="c-114186367"
							class="qiushi_comments" target="_blank"> <i class="number">${aai.getAnnRacc()}</i>
								评论
						</a>
						</span>  --%>
					</div>
					</c:forEach>
				</c:if>
			</div>
		   <div class="content-right">
		   
				<c:if test="${ empty logoner }">
					<div class="box2">
						<table>
							<tr>
								<td>
									<a href="pages/logon.jsp" class="fn-signin-required logintop" id='logintop' rel="nofollow">
										<img src="photos/user.png" alt="" style="width:100px;height:100px;">
										<h4 style="color:#ff6764">用户登录</h4>
									</a>
								</td>
							</tr>
						</table>
					</div>
					<div class="box2" style="padding:10px;">
						<a href="pages/logon.jsp" class="fn-signin-required logintop" id='logintop' rel="nofollow">
							<div class="fatie">
								<h2>发帖</h2>
							</div>
						</a>		
					</div>
				</c:if>
				
				<c:if test="${ not empty logoner }">	
					<div class="box2">
						<table>
							<tr>
								<td>
									<a href="HostServlet?userId=${ logoner.getUserId() }" class="fn-signin-required logintop" id='logintop' rel="nofollow">
										<img src=${logoner.getUserShow()} alt="" style="width:100px;height:100px;">
									</a>
								</td>
							</tr>
							<tr><td><p>用户名：<a href="HostServlet?userId=${ logoner.getUserId() }"  style="color:#9b8878">${logoner.getUserName()}</a></p></td></tr>
							<tr><td><p>帖子数量：${logoner.getUserAnnCount()}</p></td></tr>
							<tr><td>
							<p><a href="UserServlet?action=logout" style="color:#2fae85">退出登录</a>
							<a href="pages/cancel.jsp" style="color:#2fae85">&nbsp&nbsp&nbsp注销账号</a></p>
							</td>							
						</table>
					</div>
									
					<div class="box2" style="padding:10px;">
							<div class="fatie">
							<a href="pages/post.jsp"><h2>发帖</h2></a>
							</div>						
					</div>
				</c:if>
				
				<div class="box2">
					<div class="box2_title">
						<h2>最新话题</h2>
					</div>
					<div id="Tab2">
						<c:forEach items="${allAnnList}" var="aai" begin="0" end="7">
							<div class="list">
							<br>
							<dl>                       
		                        <dd>
		                        <ul>
		                        <li>                                       
		                         <%-- <a href="HostServlet?userId=${user.getUserId()}" rel="nofollow" target="_blank"><img alt="slwsss" class="photo" src=${user.getUserShow()}></a> --%>
		                         <a href="ReadServlet?ID=${aai.getAnnID()}" rel="nofollow" target="_blank"><h1>${aai.getAnnTopic()}</h1></a>
		                        </li>
		                        </ul>
		                      <br>
							</div>
						</c:forEach>
					</div>
				</div>
				
			</div> 
		</div>
	</div>
	<jsp:include page="end.jsp"></jsp:include>
</html>